import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  //获取关联规则
  getRulesData: (query) => api.get(`${config.interfaces.type5}risk-config/risk/rule/unitedList`, query),
  //创建限额规则
  createRule: (query) => api.post(`${config.interfaces.type5}risk-config/risk/rule/create`, query),
  //修改限额规则
  modifyRule: (query) => api.post(`${config.interfaces.type5}risk-config/risk/rule/update`, query),
  //删除限额规则
  deleteRule: (query) => api.get(`${config.interfaces.type5}risk-config/risk/rule/delete`, query),
  //查询限额列表
  queryRules: (query) => api.post(`${config.interfaces.type5}risk-config/risk/rule/list`, query),
  //证券范围下拉
  queryConditionByFactorCode: (query) => api.get(`${config.interfaces.type5}risk-config/risk/configOptionQuery/queryConditionByFactorCode`, query),
  //  根据选中的数据查询公式右侧的数据
  queryConditionByIndexClassInfo: (query) => api.get(`${config.interfaces.type5}risk-config/risk/configOptionQuery/queryConditionByIndexClassInfo`, query),
  //计算因子 下拉
  queryFactorByIndexClass: (query) => api.get(`${config.interfaces.type5}risk-config/risk/configOptionQuery/queryFactorByIndexClass`, query),
  //查询产品
  queryRootNodeAll: (query) => api.get(`${config.interfaces.type5}risk-config/risk/configOptionQuery/getProductList`, query),

  //新增分子的模板
  addTemplate: (query) => api.post(`${config.interfaces.type5}risk-config/risk/demoIndex/create`, query),
  //查询分子的模板列表
  queryTemplateList: (query) => api.get(`${config.interfaces.type5}risk-config/risk/demoIndex/list`, query),
  //删除分子的模板
  deleteTemplate: (query) => api.get(`${config.interfaces.type5}risk-config/risk/demoIndex/delete`, query),
  //查询限额详情
  queryRuleDatail: (query) => api.get(`${config.interfaces.type5}risk-config/risk/rule/get`, query),
};
